package com.wangzz.mallchat.common.common.utils;

import com.wangzz.mallchat.common.common.domain.dto.RequestInfo;

public class RequestHolder {

    public static final ThreadLocal<RequestInfo> USER_HOLDER = new ThreadLocal<>();

    public static void setUser(RequestInfo user) {
        USER_HOLDER.set(user);
    }

    public static RequestInfo getUser() {
        RequestInfo requestInfo = USER_HOLDER.get();
        return requestInfo;
    }

    public static void removeUser() {
        USER_HOLDER.remove();
    }
}
